# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema do
  @moduledoc """
  Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed.

  ## Attributes

  *   `anyOf` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema.t)`, *default:* `nil`) - Optional. The value should be validated against any (one or more) of the subschemas in the list.
  *   `default` (*type:* `any()`, *default:* `nil`) - Optional. Default value of the data.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. The description of the data.
  *   `enum` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}
  *   `example` (*type:* `any()`, *default:* `nil`) - Optional. Example of the object. Will only populated when the object is the root.
  *   `format` (*type:* `String.t`, *default:* `nil`) - Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
  *   `items` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema.t`, *default:* `nil`) - Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
  *   `maxItems` (*type:* `String.t`, *default:* `nil`) - Optional. Maximum number of the elements for Type.ARRAY.
  *   `maxLength` (*type:* `String.t`, *default:* `nil`) - Optional. Maximum length of the Type.STRING
  *   `maxProperties` (*type:* `String.t`, *default:* `nil`) - Optional. Maximum number of the properties for Type.OBJECT.
  *   `maximum` (*type:* `float()`, *default:* `nil`) - Optional. Maximum value of the Type.INTEGER and Type.NUMBER
  *   `minItems` (*type:* `String.t`, *default:* `nil`) - Optional. Minimum number of the elements for Type.ARRAY.
  *   `minLength` (*type:* `String.t`, *default:* `nil`) - Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
  *   `minProperties` (*type:* `String.t`, *default:* `nil`) - Optional. Minimum number of the properties for Type.OBJECT.
  *   `minimum` (*type:* `float()`, *default:* `nil`) - Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
  *   `nullable` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates if the value may be null.
  *   `pattern` (*type:* `String.t`, *default:* `nil`) - Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
  *   `properties` (*type:* `%{optional(String.t) => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema.t}`, *default:* `nil`) - Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
  *   `propertyOrdering` (*type:* `list(String.t)`, *default:* `nil`) - Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
  *   `required` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Required properties of Type.OBJECT.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Optional. The title of the Schema.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Optional. The type of the data.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :anyOf => list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema.t()) | nil,
          :default => any() | nil,
          :description => String.t() | nil,
          :enum => list(String.t()) | nil,
          :example => any() | nil,
          :format => String.t() | nil,
          :items => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema.t() | nil,
          :maxItems => String.t() | nil,
          :maxLength => String.t() | nil,
          :maxProperties => String.t() | nil,
          :maximum => float() | nil,
          :minItems => String.t() | nil,
          :minLength => String.t() | nil,
          :minProperties => String.t() | nil,
          :minimum => float() | nil,
          :nullable => boolean() | nil,
          :pattern => String.t() | nil,
          :properties =>
            %{
              optional(String.t()) =>
                GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema.t()
            }
            | nil,
          :propertyOrdering => list(String.t()) | nil,
          :required => list(String.t()) | nil,
          :title => String.t() | nil,
          :type => String.t() | nil
        }

  field(:anyOf, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema, type: :list)
  field(:default)
  field(:description)
  field(:enum, type: :list)
  field(:example)
  field(:format)
  field(:items, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema)
  field(:maxItems)
  field(:maxLength)
  field(:maxProperties)
  field(:maximum)
  field(:minItems)
  field(:minLength)
  field(:minProperties)
  field(:minimum)
  field(:nullable)
  field(:pattern)
  field(:properties, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema, type: :map)
  field(:propertyOrdering, type: :list)
  field(:required, type: :list)
  field(:title)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Schema do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
